﻿/* 
 * TABLE: Users 
 */

CREATE TABLE Users(
    UserId              int              IDENTITY(1,1),
    Email               email            NOT NULL,
    Password            binary(32)       NOT NULL,
    Salt                binary(8)        NOT NULL,
    Login               nvarchar(256)    NOT NULL,
    RegistrationDate    datetime2(0)     CONSTRAINT [DF_Users_RegistrationDate] DEFAULT getdate() NOT NULL,
    Status              tinyint          CONSTRAINT [DF_Users_Status] DEFAULT 1 NOT NULL,
    CONSTRAINT PK_Users PRIMARY KEY CLUSTERED (UserId)
)
GO
/* 
 * INDEX: I_Users_UserInfo 
 */

CREATE UNIQUE INDEX I_Users_UserInfo ON Users(Email)